#!/usr/local/env python3
#author:fonzie

from perIP.kit import sudops
from perIP.BaseHandler import BaseHandler


class IndexHandler(BaseHandler):
    def get(self, *args):
        pass

    def post(self, *args, **kwargs):
        pass


class PerIp(BaseHandler):
    def get(self, *args):
        self.render('per_ip.html')
        self.set_status(200)

    def post(self, *args, **kwargs):
        print("get post")
        ip = self.json_args.get("ip")
        # ip = self.get_arguments("ip")
        print(ip)
        message = {"ip": ip, "status": True}
        self.write(message)
        self.set_status(200)

